#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	char a[1000];
	cin.getline(a,1000);
	int i,j,len=strlen(a);
	int x=0,y=0,tx=0,ty=0;
	int k=1;
	for( i=0 ; i<len ; i++ )
	{
		if( a[i]>='a' && a[i]<='z' )
			a[i]-=32;
		if( a[i]=='-' && a[i-1]=='A' )
		{
			a[i]='0';
			a[i-1]='D';
		}
		if( a[i]=='-' && a[i-1]=='D' )
		{
			a[i]='0';
			a[i-1]='A';
		}
		if( a[i]=='-' && a[i-1]=='W' )
		{
			a[i]='0';
			a[i-1]='S';
		}
		if( a[i]=='-' && a[i-1]=='S' )
		{
			a[i]='0';
			a[i-1]='W';
		}
	}
	//puts(a);
	for( i=0 ; i<len ; i++ )
	{
		if( a[i]=='A' )
		{
			k=1;tx=0;
			while( a[++i]!=';' )
			{
				tx*=k;
				tx-=a[i]-'0';
				k=10;
			}
			//printf("tx=%d\n",tx);
			
			x+=tx;
			continue;
		}
		
		if(  a[i]=='D' )
		{
			k=1;tx=0;
			while( a[++i]!=';' )
			{
				tx*=k;
				tx+=a[i]-'0';
				k=10;
			}
			//printf("tx=%d\n",tx);
			
			x+=tx;
			continue;
		}
		
		if(  a[i]=='W' )
		{
			k=1;ty=0;
			while( a[++i]!=';' )
			{
				ty*=k;
				ty+=a[i]-'0';
				k=10;
			}
			//printf("ty=%d\n",ty);
			
			y+=ty;
			continue;
		}
		
		if(  a[i]=='S' )
		{
			k=1;ty=0;
			while( a[++i]!=';' )
			{
				ty*=k;
				ty-=a[i]-'0';
				k=10;
			}
			//printf("ty=%d\n",ty);
			
			y+=ty;
			continue;
		}
	}
	
	printf("%d,%d\n",x,y);
	return 0;
}
